# $Id: PKGBUILD 84825 2013-02-24 20:27:50Z jlichtblau $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Mateusz Herych <heniekk@gmail.com>
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
# Contributor: William Rea <sillywilly@gmail.com>

pkgname=proj
pkgver=4.8.0
pkgrel=2
pkgdesc='Cartographic Projections library.'
arch=('i686' 'x86_64')
url="http://trac.osgeo.org/proj/"
license=('MIT')
options=('!libtool')
changelog=$pkgname.changelog
source=("http://download.osgeo.org/proj/$pkgname-$pkgver.tar.gz"
        "http://download.osgeo.org/proj/$pkgname-datumgrid-1.5.zip"
        "chenyx06a.zip::http://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/software/software.parsys.7090.downloadList.55545.DownloadFile.tmp/chenyx06ntv2.zip")
sha256sums=('2db2dbf0fece8d9880679154e0d6d1ce7c694dd8e08b4d091028093d87a9d1b5'
            '723c4017d95d7a8abdf3bda4e18d3c15d79b00f9326d453da5fdf13f96c287db'
            'f61290a32815622bfe182af475c76b0b4c282de66121fdddce2f6201e8bca2e0')

build() {
  bsdtar -xzvf "${srcdir}/${pkgname}-datumgrid-1.5.zip" -C "${srcdir}/proj-${pkgver}/nad"
  bsdtar -xzvf "${srcdir}/chenyx06a.zip" -C "${srcdir}/proj-${pkgver}/nad" CHENYX06a.gsb

  cd ${srcdir}/$pkgname-$pkgver

  ./configure --prefix=/usr
  make
}

package() {
  cd ${srcdir}/$pkgname-$pkgver

  make DESTDIR=${pkgdir} install

  install -D COPYING ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
}
